package com.sskj.mine;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.UserData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.presenter.BasePresenter;
import com.sskj.mine.PersonActivity;


/**
 * @author Hey
 * Create at  2019/05/01
 */
class PersonPresenter extends BasePresenter<PersonActivity> {
    public void getUserInfo() {
        OkGo.<HttpData<UserData>>post(HttpConfig.BASE_URL + HttpConfig.GET_USER_INFO)
                .execute(new JsonCallBack<HttpData<UserData>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<UserData>> response) {
                        HttpData<UserData> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUserTitle(httpData.getData());
                        }
                    }
                });
    }
}
